const app = getApp()
const promisify = require("../../utils/promisify")

Page({
  data: {
    activityId: undefined,
    organizationId: undefined,
    activityImg: "",
    activityName: "",
    organizationImg: "",
    organizationName: "",
    breif: [],
    time: "",
    detail: []
  },
  onLoad: function (options) {
    let that = this
    that.setData({
      activityId: options.activityId
    })
    promisify(wx.request)({
      url: `https://www.lional.club:6001/activity/` + options.activityId + `.json`,
      method: "GET",
      header: {
        'content-type': 'application/json' // 默认值
      }
    }).then(
      data => {
        data = data.data
        that.setData({
          activityName: data.activityName,
          activityImg: data.activityImg,
          organizationImg: data.organizationImg,
          organizationName: data.organizationName,
          organizationId: data.organizationId,
          brief: data.brief,
          time: data.time,
          detail: data.detail
        })
      }
    )
  }
})